home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / SETDISK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  468 b   |  17 lines

  1. /* SETDISK.C --- p. 663 */
  2. #include <stdio.h>
  3. #include <ctype.h>
  4. #include <dos.h>
  5. main()
  6. {
  7.     int ch_in;
  8.     int drive, maxdrives;
  9.     printf("Enter new drive name (A, B etc): ");
  10.     scanf("%c", &ch_in);
  11.         /* Convert the letter into a number, 0 for A, 1 for B */
  12.     drive = toupper(ch_in) - 'A';
  13.     maxdrives = setdisk(drive);
  14.     drive = getdisk();
  15.     printf("The current drive is: %c\n", drive+'A');
  16.     printf("There are %d logical drives on the system\n", maxdrives);
  17. }